int waysToSplitArray(vector<int>& nums) {
    //分别求出前缀和和后缀和
    int n = nums.size();
    vector<int>pre(n);
    auto post = pre;
    //前缀和
    pre[0] = nums[0];
    for (int i = 1; i < n; i++)
        pre[i] += pre[i - 1]+nums[i];
    post[n - 1] = nums[n - 1];
    for (int i = n - 2; i >= 0; i--)
        post[i] += post[i + 1]+nums[i];

    //int i=0;
    int ret = 0;
    for (int i = 0; i < n - 1; i++)
    {
        int pre_sum = pre[i];
        int post_sum = post[i + 1];
        if (pre_sum >= post_sum)ret++;
    }


    for (int i = 0; i < n; i++)cout << pre[i] << " ";
    cout << endl; 
    for (int i = 0; i < n; i++)cout << post[i] << " ";
    cout << endl; 
    return ret;

}
